(function () {
    angular.module('app')
        .component('xxHome', {
            templateUrl: '/app/user/home/home.html',
            controller: ctrl
        });

    function ctrl($scope,HomeFactory,userService,$state) {
        $scope.pictures = [
            "http://123.207.188.142:20163/src/images/tjp.jpg",
            "http://123.207.188.142:20163/src/images/csy.jpg",
            "http://123.207.188.142:20163/src/images/zjj.jpg",
            "../../../src/images/yt.jpeg",
            "http://123.207.188.142:20163/src/images/xyy.jpg"
        ]

        $scope.consultantList = [];
        function getConsultantList() {
            function cb(err,res) {
                if(!err)$scope.consultantList = res;
                //console.log(err,res);
            }
            HomeFactory.getConsultantList(cb);
        }
        getConsultantList();

        $scope.personInfo = function (username) {
            $state.go('show.person-info',{username:username})
        }


        $scope.travel = function () {
            $state.go('show.travel')
        }
        $scope.career = function () {
            $state.go('show.career')
        }
        $scope.gym = function () {
            $state.go('show.gym')
        }
        $scope.iDesign = function () {
            $state.go('show.iDesign')
        }
        $scope.car = function () {
            $state.go('show.car')
        }
        $scope.law = function () {
            $state.go('show.law')
        }
    }

})()
